package jp.ne.hatena.d.digitalsoul.warikan.contexts

import jp.ne.hatena.d.digitalsoul.warikan.contexts.rootpopulaters._
import jp.ne.hatena.d.digitalsoul.warikan.models._
import jp.ne.hatena.d.digitalsoul.warikan.repositories._
import jp.ne.hatena.d.digitalsoul.warikan.roles._

class Preparation(val id:Int) extends SlopePopulater {
	
	val administrator:Administrator = 
		new Slope(id) with Administrator
	
	val slope:Slope = populateSlope(administrator)
	
	def addMapping(role:String, weight:Int) = 
		administrator.addMapping(role, weight)
	
	def weightOf(role:String):Int = administrator.weightOf(role)
	
	def commit = SlopeRepository.add(slope)

}